/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.t4.irc.net.packet;

import com.t4.irc.IRC;

/**
 * Packet Factory
 * @author T4_
 */
public class PacketFactory {
	
	/**
	 * Prints names in a channel
	 * @param destination
	 * @return
	 */
	public static void names(String destination) {
		IRC.getConnector().sendRawLine("NAMES " + destination);
	}

	/**
	 * Changes the user's nickname
	 * @param nickname
	 */
	public static void nick(String nickname) {
		IRC.getConnector().sendRawLine("NICK " + nickname);
	}
	
    /**
     * Joins a channel
     * @param destination
     */
    public static void join(String destination) {
      IRC.getConnector().sendRawLine("JOIN " + destination);
    }

    /**
     * Parts a channel
     * @param destination
     * @param message
     */
    public static void part(String destination, String message) {
    	IRC.getConnector().sendRawLine("PART " + destination + " :" + message);
    }

    /**
     * Quits
     * @param message
     */
    public static void quit(String message) {
    	IRC.getConnector().sendRawLine("QUIT " + " :" + message);
    }

    /**
     * Sends a message
     * @param destination
     * @param message
     */
    public static void sendMessage(String destination, String message) {
    	IRC.getConnector().sendRawLine("PRIVMSG " + destination + " :" + message);
    }
}
